package com.aliyunlog.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

public class DateUtil {
	
	private static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	
	public static String toDateStr(Date d){
		return df.format(d);
	}
	
	
	public static void main(String[] args) {
		System.out.println(toDateStr(new Date()));
		
		String s = "[client.JmonitorClient] [bizId:cyb-149858032861976973609] message:[Connection refused]";
		
		boolean flag = StringUtils.contains(s, "Connection refused");
		
		System.out.println(flag);
	}
	

}
